home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / numtow_1 / convertd.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-09-08  |  5.0 KB  |  170 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   5685
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   5685
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Frame frameCase 
  13.       Caption         =   "Case"
  14.       Height          =   1215
  15.       Left            =   120
  16.       TabIndex        =   10
  17.       Top             =   720
  18.       Width           =   1815
  19.       Begin VB.OptionButton OptCase 
  20.          Caption         =   "lower case"
  21.          Height          =   195
  22.          Index           =   2
  23.          Left            =   240
  24.          TabIndex        =   13
  25.          Top             =   840
  26.          Width           =   1335
  27.       End
  28.       Begin VB.OptionButton OptCase 
  29.          Caption         =   "Title Case"
  30.          Height          =   195
  31.          Index           =   0
  32.          Left            =   240
  33.          TabIndex        =   12
  34.          Top             =   360
  35.          Value           =   -1  'True
  36.          Width           =   1215
  37.       End
  38.       Begin VB.OptionButton OptCase 
  39.          Caption         =   "UPPER CASE"
  40.          Height          =   195
  41.          Index           =   1
  42.          Left            =   240
  43.          TabIndex        =   11
  44.          Top             =   600
  45.          Width           =   1455
  46.       End
  47.    End
  48.    Begin VB.TextBox txtUnit 
  49.       Enabled         =   0   'False
  50.       Height          =   285
  51.       Left            =   4080
  52.       TabIndex        =   8
  53.       Text            =   "Cent"
  54.       Top             =   1080
  55.       Width           =   1455
  56.    End
  57.    Begin VB.TextBox txtCurrencyType 
  58.       Enabled         =   0   'False
  59.       Height          =   285
  60.       Left            =   2520
  61.       TabIndex        =   6
  62.       Text            =   "Dollar"
  63.       Top             =   1080
  64.       Width           =   1455
  65.    End
  66.    Begin VB.CheckBox chkUseCurrency 
  67.       Caption         =   "Use Currency"
  68.       Height          =   255
  69.       Left            =   2520
  70.       TabIndex        =   5
  71.       Top             =   360
  72.       Width           =   1815
  73.    End
  74.    Begin VB.TextBox txtWords 
  75.       Height          =   285
  76.       Left            =   0
  77.       TabIndex        =   3
  78.       Top             =   2280
  79.       Width           =   5535
  80.    End
  81.    Begin VB.TextBox txtNumber 
  82.       Height          =   285
  83.       Left            =   120
  84.       TabIndex        =   1
  85.       Text            =   "100.15"
  86.       Top             =   360
  87.       Width           =   1815
  88.    End
  89.    Begin VB.CommandButton cmdConvert 
  90.       Caption         =   "Convert to Words"
  91.       Height          =   495
  92.       Left            =   3360
  93.       TabIndex        =   0
  94.       Top             =   2640
  95.       Width           =   2175
  96.    End
  97.    Begin VB.Label Label4 
  98.       Caption         =   "Unit"
  99.       Height          =   255
  100.       Left            =   4080
  101.       TabIndex        =   9
  102.       Top             =   720
  103.       Width           =   1095
  104.    End
  105.    Begin VB.Label Label3 
  106.       Caption         =   "Currency"
  107.       Height          =   255
  108.       Left            =   2520
  109.       TabIndex        =   7
  110.       Top             =   720
  111.       Width           =   1095
  112.    End
  113.    Begin VB.Label Label2 
  114.       Caption         =   "Words:"
  115.       Height          =   255
  116.       Left            =   0
  117.       TabIndex        =   4
  118.       Top             =   2040
  119.       Width           =   1215
  120.    End
  121.    Begin VB.Label Label1 
  122.       Caption         =   "Number:"
  123.       Height          =   255
  124.       Left            =   120
  125.       TabIndex        =   2
  126.       Top             =   120
  127.       Width           =   1215
  128.    End
  129. Attribute VB_Name = "Form1"
  130. Attribute VB_GlobalNameSpace = False
  131. Attribute VB_Creatable = False
  132. Attribute VB_PredeclaredId = True
  133. Attribute VB_Exposed = False
  134. Option Explicit
  135. Private Sub chkUseCurrency_Click()
  136. If chkUseCurrency.Value = Checked Then
  137.     txtCurrencyType.Enabled = True
  138.     txtUnit.Enabled = True
  139.     txtCurrencyType.Enabled = False
  140.     txtUnit.Enabled = False
  141. End If
  142. End Sub
  143. Private Sub cmdConvert_Click()
  144. 'Create an new instance of the dll
  145. Dim obj As New ConvertNum.NumtoText
  146. Dim m_UseCurrency As Boolean
  147. Dim m_CurrencyType As String
  148. Dim m_CurrencyUnit As String
  149. Dim m_Value As String
  150. Dim sCase As String
  151. If chkUseCurrency.Value = Checked Then
  152.     m_UseCurrency = True
  153.     m_CurrencyType = txtCurrencyType.Text
  154.     m_CurrencyUnit = txtUnit.Text
  155.     m_UseCurrency = False
  156.     m_CurrencyType = ""
  157.     m_CurrencyUnit = ""
  158. End If
  159. If OptCase(0).Value = True Then sCase = "Title"
  160. If OptCase(1).Value = True Then sCase = "Upper"
  161. If OptCase(2).Value = True Then sCase = "Lower"
  162. m_Value = txtNumber.Text
  163. 'Call procedure and convert
  164. txtWords.Text = obj.fchange(m_Value, sCase, m_UseCurrency, m_CurrencyType, m_CurrencyUnit)
  165. End Sub
  166. Private Sub Form_Resize()
  167. txtWords.Width = Form1.Width - 200
  168. cmdConvert.Left = Form1.Width - (cmdConvert.Width + 200)
  169. End Sub
  170.